┌────────────────────────────────┐ │ ░░░ ░░▓ ░▓▓ ███ ▓▓░ ▓░░ │ │ ~ M O O N ~ │ └────────────────────────────────┘
prd-web-01.centraldc.gr
LOCATION:
/usr/share/pie/src/ComposerIntegration/Listeners
☗ ROOT
↻ REFRESH
✎ EDIT FILE
EDITING: RemoveUnrelatedInstallOperations.php
<?php declare(strict_types=1); namespace Php\Pie\ComposerIntegration\Listeners; use Closure; use Composer\Composer; use Composer\DependencyResolver\Operation\InstallOperation; use Composer\DependencyResolver\Operation\OperationInterface; use Composer\DependencyResolver\Operation\UninstallOperation; use Composer\DependencyResolver\Transaction; use Composer\Installer\InstallerEvent; use Composer\Installer\InstallerEvents; use Composer\IO\IOInterface; use Php\Pie\ComposerIntegration\PieComposerRequest; use function array_filter; use function assert; use function sprintf; /** @internal This is not public API for PIE, so should not be depended upon unless you accept the risk of BC breaks */ class RemoveUnrelatedInstallOperations { public function __construct( private readonly PieComposerRequest $composerRequest, ) { } public static function selfRegister( Composer $composer, PieComposerRequest $composerRequest, ): void { $composer ->getEventDispatcher() ->addListener( InstallerEvents::PRE_OPERATIONS_EXEC, new self($composerRequest), ); } public function __invoke(InstallerEvent $installerEvent): void { $pieOutput = $this->composerRequest->pieOutput; $newOperations = array_filter( $installerEvent->getTransaction()?->getOperations() ?? [], function (OperationInterface $operation) use ($pieOutput): bool { if (! $operation instanceof InstallOperation && ! $operation instanceof UninstallOperation) { $pieOutput->writeError( sprintf( 'Unexpected operation during installer: %s', $operation::class, ), verbosity: IOInterface::VERY_VERBOSE, ); return false; } $isRequestedPiePackage = $this->composerRequest->requestedPackage->package === $operation->getPackage()->getName(); if (! $isRequestedPiePackage) { $pieOutput->writeError( sprintf( 'Filtering package %s from install operations, as it was not the requested package', $operation->getPackage()->getName(), ), verbosity: IOInterface::VERY_VERBOSE, ); } return $isRequestedPiePackage; }, ); $overrideOperations = Closure::Bind( static function (Transaction $transaction) use ($newOperations): void { $transaction->operations = $newOperations; }, null, Transaction::class, ); assert($overrideOperations !== null); $overrideOperations($installerEvent->getTransaction()); } }
CANCEL
Name
Type
Size
Modified
Actions
↩ ..
DIR
—
—
📄 CouldNotDetermineDownloadUrlMethod.php
PHP
1.3 KB
2026-04-14 00:00
EDIT
📄 OverrideDownloadUrlInstallListener.php
PHP
5.9 KB
2026-04-14 00:00
EDIT
📄 RemoveUnrelatedInstallOperations.php
PHP
2.9 KB
2026-04-14 00:00
EDIT